{% load comp_filters %}
{% load hash_filters %}
{% load glue_filters %}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>{{SERVICE.name}}</title>
  <meta name="description" content="Sydney Adult Services Distribution"></meta>
  <link rel="stylesheet" href="/css/{{CSS_ROOT}}/service.css" type="text/css" media="all" charset="utf-8"/>
  <link rel="stylesheet" href="/css/{{CSS_ROOT}}/dialog.css" type="text/css" media="all" charset="utf-8"/>
  <link rel="stylesheet" href="/css/{{CSS_ROOT}}/element.css" type="text/css" media="all" charset="utf-8"/>
  <link rel="stylesheet" href="/css/{{CSS_ROOT}}/general.css" type="text/css" media="all" charset="utf-8"/>
  <link rel="stylesheet" href="/css/{{CSS_ROOT}}/nav.css" type="text/css" media="all" charset="utf-8"/>
  <link rel="stylesheet" href="/css/{{CSS_ROOT}}/960.css" type="text/css" media="all" charset="utf-8"/>

  <!-- YUI Components --> 
  <script type="text/javascript" charset="utf-8" src="http://yui.yahooapis.com/3.2.0/build/yui/yui-min.js">
  </script>

  <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>
  <!-- need finally make a new js file contain all the info manage script -->	
  <script type="text/javascript" src="/js/mesh.js"></script>
  <script type="text/javascript" src="/js/histogram.js"></script>
  <!-- Project Components -->

  <script type="text/javascript" src="/js/ui.js"></script>
  <script type="text/javascript" src="/js/comps.js"></script>
  <script type="text/javascript" src="/js/zoyoe.js"></script>
  <script type="text/javascript" src="/js/ele.js"></script>
  <script type="text/javascript" src="/js/surburb.js"></script>
  <script type="text/javascript" src="/js/home.js"></script>

  <script type="text/javascript">
  function GetTitle(obj){
    var ns = obj.getElementsByTagName('div');
    for(var i=0;i<ns.length;i++){
      if(ns[i].className == 'title'){
        return ns[i].getElementsByTagName('h3')[0];
      }
    }
    return null;
  }
  function Init(){
    var mid = document.getElementById('mid-section');
    var left = document.getElementById('left-section');
    var right = document.getElementById('right-section');
    var basic_info = document.getElementById('info');
    var time_table = document.getElementById('timetable');
    var roster = document.getElementById('roster');
    var photos = document.getElementById('photoplayer');
    var items = document.getElementById('items');
    var icon = document.getElementById('icon');
    var gallery = document.getElementById('gallery');
    var news = document.getElementById('news');
    var preview = document.getElementById('mappreview');
    InitDrag(document.getElementById('dd-shadow'));
    if(false){
      if(mid){
        MarkAsArrangeV(mid,time_table.parentNode,GetTitle(time_table));
        MarkAsArrangeV(mid,roster.parentNode,GetTitle(roster));
        MarkAsArrangeV(mid,photos.parentNode,GetTitle(photos));
        MarkAsArrangeV(mid,news.parentNode,GetTitle(news));
      }
      if(left){
        MarkAsArrangeV(left,basic_info.parentNode,GetTitle(basic_info));
        MarkAsArrangeV(left,icon.parentNode,GetTitle(icon));
        MarkAsArrangeV(left,item.parentNode,GetTitle(item));
        MarkAsArrangeV(left,preview.parentNode, GetTitle(preview));
        MarkAsArrangeV(left,gallery.parentNode,GetTitle(gallery));
      }
      if(right){
        MarkAsArrangeV(right,forum.parentNode,GetTitle(forum));
      }
    }
    YUI().use('node','io-form',function(Y){
      //zoyoe.InitZoyoe(true,Y);
      zoyoe.InitZoyoe(false,Y);
      zoyoe.service_name = '{{SERVICE.name}}';
      zoyoe.comps['item'] = InitItems(zoyoe,'item');
      zoyoe.comps['GALLERY'] = InitGallery(zoyoe);
      zoyoe.comps['ROSTER'] = InitRoster(zoyoe,zoyoe.week_day.{{WEEK_DAY}});
      zoyoe.comps['LAYOUT'] = InitLayout(zoyoe);
      zoyoe.comps['ICON'] = InitIcon(zoyoe);
      zoyoe.comps['BASIC_INFO'] = InitBasicInfo(zoyoe);
      zoyoe.comps['timetable'] = InitItems(zoyoe,'timetable');
//    zoyoe.comps['preview'] = InitPreview(zoyoe,'preview');
      zoyoe.admin = InitAdmin(zoyoe);
      if(zoyoe.ElementExtension){
        zoyoe.ElementExtension.BuildExtensionElements();
      }
    });
  }
  </script>
</head>

<body onload='Init()'>
  <div id="title-bar">
    <div class="nav">
      <div class="brand">
        <a href="/search/"><img src="/res/auadult.png" height="30px"/></a>
      </div>
      <div class="nav-button-tray">
        <a class="nav-button" href="/search/">Homepage</a>
        <a class="nav-button" href="/map/">Map</a>
        <a class="nav-button" href="/forum/">Forum</a>
        <a class="nav-button" href="/mark/">Recommendation</a>
        <a class="nav-button" onclick="zoyoe.admin.ShowAboutUsDialog()">About Us</a>
        {% if user.is_authenticated %}
        <div class="nav-button" id="nav-button-welcome" style="width:120px;" align="center">
          <span style="text-transform">Service Config</span> 
          <img src="/res/welcome_arrow.png"></img>
          <div id="nav-welcome" align="left">
            <ul>
              <li><a onclick ="zoyoe.comps['LAYOUT'].Template()">Change Template</a></li>
              <li><a onclick ="zoyoe.comps['LAYOUT'].Color()">Change Color Theme</a></li>
              <li><a onclick ="zoyoe.admin.EnableForum('{{SERVICE.name}}')">Enable Forum</a></li>
              <li id="nav-welcome-separate"></li>
              <li><a onclick ="zoyoe.admin.ResetService('{{SERVICE.name}}')">Reset Service</a></li>
              <li><a onclick ="zoyoe.admin.DeleteService('{{SERVICE.name}}')">Delete Service</a></li>
            </ul>
          </div>
        </div>
        {% else %}
        <a class="nav-button" onclick ="zoyoe.admin.ShowLoginDialog()">Login</a>
        <a class="nav-button" onclick ="zoyoe.admin.ShowRegisterDialog()">Register</a>
        {% endif %}
        {% if user.is_authenticated %}
          {% include "core/_usrmenu.html" %}
        {% endif %}
      </div>
    </div>
  </div>

<!--
<div class='nav'>
  <ul>
    {% if user.is_authenticated %}
    <li class='menu' style="width:60px;">
      <a>Actions</a>
      <ul class='submenu'>
      {% if HAS_AUTHORITY %}
      <li class='submenu' onclick ="zoyoe.comps['LAYOUT'].Template()"><a>Template</a></li>
      <li class='submenu' onclick ="zoyoe.comps['LAYOUT'].SaveLayout()"><a>Save Current Layout</a></li>
      <li class='submenu' onclick ="zoyoe.admin.EnableForum('{{SERVICE.name}}')"><a>Enable Forum</a></li>
      <li class='submenu' onclick ="zoyoe.admin.DeleteService('{{SERVICE.name}}')"><a>Delete Service</a></li>
      <li class='submenu' onclick ="zoyoe.admin.ResetService('{{SERVICE.name}}')"><a>Reset Service</a></li>
      {% endif %}
      <li class='submenu' onclick ="zoyoe.admin.ShowChangePWDDialog()"><a>Reset Password</a></li>
      </ul>
      </a>
    </li>
    <li class='menu' onclick ="zoyoe.admin.Logout()"><a>Logout</a></li>
    {% else %}
    <li class='menu' onclick ="zoyoe.admin.ShowLoginDialog()"><a>Login</a></li>
    <li class='menu' onclick ="zoyoe.admin.ShowRegisterDialog()"><a>Register</a></li>
    {% endif %}
    <li class='menu'><a href='/search/'>Home</a></li>
    <li class='menu'><a href='/map/'>Distribution</a></li>
    <li class='menu'><a href='/mark/'>Recommandations</a></li>
  </ul>
</div>
-->
<!--<div style="border: 1px solid gray;width: 1024px;margin: 0px auto 30px;">-->
  <!--<div id="service-title">
    <h1>12Cottam.<span>com.au</span></h1>
    <h3>Welcome</h3>
  </div>
  <div id="service-title-bottom">
  </div>-->

  <div class='nav-sup'>
  {% collect SERVICE user %}
  </div>
  <div class="nav-last" style="height:1px;"></div>
  <div class="page">
  {% with TEMPLATE|component:"main" as main %} 
  {% include main %}
  {% endwith %}
  </div>

  <div class="foot">
    <div id="contact">
      <p>Contact 9262 7900 / <a href="mailto:acnwco@gmail.com">info@adultsservice.com.au</a> to advertise here</p>
    </div>
    <div id="copyright">
      <p>&copy; 2011 <a href="http://www.adultsservice.com.au/">Adults Service</a> All Rights Reserved</p>
    </div>
    <p class="clear"></p>
  </div>

  <div id='zsk' class='msk'>
  </div>
  <div id='panel'>
    <div class='panel'>
      <div class='panel-hint'>
      </div>
      <div class='panel-content'>
      </div>
      <div class='panel-left'>
      </div>
      <div class='button-lane'>
      </div>
    </div>
  </div>
  <div id='dd-container' style="z-index:99;opacity:0.8;position:absolute;black;display:none;"></div>
  <div id='dd-shadow' class='section-container' style="position:absolute;border:1px dashed gray;display:none;"></div>
  <br style="clear:both"/>
  <form name='reload' url='/core/service/{{SERVICE.name}}/'></form>
<!--</div>-->
</body>
</html>
